﻿@model Battleborn.Core.Models.UserProfile 

<input type="text" id="msg" value=" " />
    <input type="button" id="send" value="send" />
    <ul id="message">
    </ul>
    <script>
        $(function () {
            var chat = $.connection.chat,
                name = null;

            chat.client.send = function (message) {
                $('#message').append('<li>' + message + '</li>');
            };

            while (!name) {
                // Get a name
                name = user.Name;
            }

            // Set the name
            $.connection.hub.qs = "name=" + name;

            $.connection.hub.start().done(function () {
                $('#send').click(function () {
                    chat.server.send($('#msg').val());
                });
            });
        });
    </script>
